﻿// Использование static методов и переменных

using System;

class StaticClassDemo
{
    public static void _Main()
    {
        for (int i = 0; i < 10; i++)
        {
            StaticClass sc = new StaticClass();
            Console.WriteLine(StaticClass.GetCount());
            
        }

        Console.ReadLine();
    }
}

class StaticClass
{
    public static int count;

    public StaticClass()
    {
        count++;
    }

    ~StaticClass()
    {
        count--;
    }

    public static int GetCount()
    {
        return count;
    }
}